package ai.text.impl;

import edu.uci.ics.jung.graph.Graph;
import ai.text.TextAnalyse;

public class TextAnalyzerImpl extends TextAnalyse {
	
	private OpenNLPAdapter openNLP = new OpenNLPAdapter();

	@Override
	public Graph parseText(String text) {
		String[] sents = openNLP.getSentenses(text);
		if(sents.length > 1) {
			throw new IllegalStateException("Only one sentance supported");
		}
		for(String sent : sents) {
			return openNLP.buildGraph(openNLP.getFullParseTree(sent));
		}
		return null;
	}

}
